from datetime import datetime

from app.schema.base import (
    InfoSchema,
    RespDetailSchema,
    RespDataSchema,
    RespBaseSchema,
    BaseModel,
)

class FileInfoSchema(InfoSchema):
    parent_name: str


class FileDetailSchema(FileInfoSchema):
    created_time: datetime
    updated_time: datetime
    
    


class OSSParmasSchema(BaseModel):
    OSSAccessKeyId: str
    policy: str
    signature: str


class OSSResponseSchema(RespBaseSchema):
    data: OSSParmasSchema


class UploadFileSchema(BaseModel):
    ai_id: int
    user_id: int = 0
    size: str
    extension: str
    url: str
    name: str
    status: int = 0  # 0:处理中，1：已处理，2：处理失败


class MilvusFileSchema(BaseModel):
    file_id: int
    file_name: str
    url: str


class UpdataFileSchema(InfoSchema):
    id: int = 0
    is_delete: int = None
    status: int = None  # 0:处理中，1：已处理，2：处理失败

class DeleteFileSchema(BaseModel):
    id: int = 0


class FileContextWithName(BaseModel):
    file_name: str
    content:str
    